package whf.framework.workflow.engine;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

public final class TaskInstanceState implements Serializable {

	private static final long serialVersionUID = -8664257701455068539L;

	public static final String TASK_STATE_CREATED = "TASK_STATE_CREATED";
	public static final String TASK_STATE_ALL = "TASK_STATE_ALL";
	public static final String TASK_STATE_STARTED = "TASK_STATE_STARTED";
	public static final String TASK_STATE_CLOSED = "TASK_STATE_CLOSED";
	public static final String TASK_STATE_SUSPENDED = "TASK_STATE_SUSPENDED";
	public static final String TASK_STATE_CANCELLED = "TASK_STATE_CANCELLED";
	public static final String TASK_STATE_REJECTED = "TASK_STATE_REJECTED";

	private static final String[] TASK_STATE_ACTIVE = new String[] { TASK_STATE_CREATED, TASK_STATE_ALL,
			TASK_STATE_STARTED, TASK_STATE_SUSPENDED, TASK_STATE_REJECTED, };

	private static final String[] TASK_STATE_NOT_ACTIVE = new String[] { TASK_STATE_CLOSED, TASK_STATE_CANCELLED, };

	private TaskInstanceState() {
	}

	public static List<String> getActiveStates() {
		return Arrays.asList(TASK_STATE_ACTIVE);
	}

	public static List<String> getNotActiveStates() {
		return Arrays.asList(TASK_STATE_NOT_ACTIVE);
	}

}
